package com.lxq.test1903.Main01;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();//数的个数
        int[] num = new int[3];
        float fnum = 0f;
        BigDecimal bd = null;

        for (int i=0;i<n;i++){
            int temp = sc.nextInt();

            if (i==0) num[0] = temp;
            if (i==n-1) num[2] = temp;
            if ((n%2!=0)&&(i==n/2)) num[1] = temp;
            if (n%2==0){
                if (i==n/2-1) num[1] = temp;
                if (i==n/2&&(num[1]+temp)%2==0){
                    num[1] = (num[1] + temp) / 2;
                }else if(i==n/2&&(num[1]+temp)%2!=0){
//                    num[1] = (num[1] + temp) / 2;
//                    fnum = 1;

                    bd = new BigDecimal((float) (num[1] + temp)/2).setScale(1, BigDecimal.ROUND_HALF_UP);

//                    DecimalFormat df = new DecimalFormat("#.#");
//                    fnum = Float.parseFloat(df.format((num[1] + temp)/2));
                }
            }
        }

        if (num[0]<num[2]) {
            int temp = num[2];
            num[2] = num[0];
            num[0] = temp;
        }
//        if (fnum==0){
//            System.out.println(num[0]+" "+num[1]+" "+num[2]);
//        }else{
//            System.out.println(num[0]+" "+num[1]+".5"+" "+num[2]);
//        }

        if (bd==null){
            System.out.println(num[0]+" "+num[1]+" "+num[2]);
        }else{
            System.out.println(num[0]+" "+bd+" "+num[2]);
        }


    }
}
